/*
 * Carrier.hpp
 *
 *  Created on: Feb 4, 2015
 *      Author: wasp
 */

#ifndef CARRIER_HPP_
#define CARRIER_HPP_

class QNetworkReply;
namespace de
{
    namespace heimweghelden
    {
        namespace network
        {
            enum METHOD {
                POST, GET
            };
            class Carrier: public QObject
            {
                Q_OBJECT
                public:
                    Carrier(METHOD m, QObject* parent = NULL);
                    virtual ~Carrier();
                    QString methodurl;
                    void setReply(QNetworkReply* r) { _reply = r; }
                    void setData(QVariantMap* d) { _data = d; }
                    METHOD method() { return _method; }
                    QVariantMap* data() { return _data; }
                    QNetworkReply* reply() { return _reply; }
                    signals:
                        void finished();
                    public slots:
                        void onRequestFinished();
                private:
                    QNetworkReply* _reply;
                    QVariantMap* _data;
                    METHOD _method;
            };

        } /* namespace network */
    } /* namespace heimweghelden */
} /* namespace de */

#endif /* CARRIER_HPP_ */
